const path = require('path');
const aliasPath = require('../tsconfig.json').compilerOptions.paths;

module.exports = {
    test: /\.tsx?$/,
    exclude: /node_modules/,
    use: ['babel-loader', 'ts-loader'],
    // entry: './src/index.js',
    output: {
        filename: 'bundle.js',
        path: path.resolve(__dirname, 'dist')
    },
    resolve: {
        extensions: ['.ts', '.tsx', '.js', '.jsx'],
        alias: Object.keys(aliasPath).reduce((alias, key) => {
            alias[key] = path.resolve(aliasPath[key][0]) + '';
            return alias;
        }, {})
    }
}


